import request from '@/utils/request';
// 获取正在使用卡片数目
export function useingCardNum(query) {
  return request({
    url: '/system/info/CardCount',
    method: 'get',
  })
}
// 获取余额
export function amountQuery(query) {
  return request({
    url: '/system/amount/amountQuery',
    method: 'post',
  })
}
export function batchRechargeTest(query) {
  return request({
    url: '/whty/list/batchRechargeTest',
    method: 'post',
    data: query
  })
}
//获取当前用户的sim卡功能状态
export function simStatus(query) {
	if(!query){
	return request({
    url: '/system/info/simStatus',
    method: 'post',
  })
	}else{
		return request({
    url: '/system/info/simStatus?bactNo='+query,
    method: 'post',
  })
	}
}
//即将到期卡
export function lastThreeMonthData(query) {
	if(!query){
			return request({
	    url: '/system/info/lastThreeMonthData',
	    method: 'get',
	  })
	}else{
		return request({
    url: '/system/info/lastThreeMonthData?bactNo='+query,
    method: 'get',
  })
	}
  
}

//sim卡业务状态
export function simBusinessStatus(query) {
	if(!query){
		 return request({
    url: '/system/info/simBusinessStatus',
    method: 'post',
  })
	}else{
		 return request({
    url: '/system/info/simBusinessStatus?bactNo='+query,
    method: 'post',
  })
	}
 
}
//本月grs流量
export function getCurrentMonthFlowUsed(query) {
	if(!query){
		return request({
    url: '/whty/currentDaytotal/getCurrentMonthFlowUsed',
    method: 'post',
  })
	}else{
		return request({
    url: '/whty/currentDaytotal/getCurrentMonthFlowUsed',
    method: 'post',
    params: query
  })
	}
}
//消耗top5
export function getTop5(query) {
	if(!query){
		return request({
    url: '/system/info/getTop5',
    method: 'get',
  })
	}else{
		return request({
    url: '/system/info/getTop5?bactNo='+query,
    method: 'get',
  })
	}
}

//获取客户选择框
export function userList(query) {
  return request({
    url: '/system/user/list',
    method: 'get',
  })
}

// 查询菜单卡信息列表
export function listInfo(query) {
  return request({
    url: '/system/info/list',
    method: 'get',
    params: query
  })
}

// 下载模板
export function importTemplate(query) {
  return request({
    url: '/system/info/importTemplate',
    method: 'get',
  })
}

// 下载模板2
export function importTemplate11(query) {
//return request({
//  url: '/whty/list/BatchImportTemplate',
//  method: 'get',
//})
    return request({
    url: '/common/down/test',
    method: 'get',
  })
}

// 批量卡导入
export function cardImport(query) {
  return request({
    url: '/whty/list/importCardByRenew',
    method: 'post',
    data: query
  })
}
//判断当前用户角色
export function judgeRole(query) {
  return request({
    url: '/system/user/judgeRole',
    method: 'get',
  })
}
//查看套餐管理折扣列表  
export function getPriceList(query) {
  return request({
    url: '/whty/discount/getPriceList',
    method: 'post',
     data: query
  })
}
////查看套餐管理折扣列表   代理商
//export function getAgentList(query) {
//return request({
//  url: '/whty/discount/getAgentList',
//  method: 'post',
//   data: query
//})
//}
////查看企业用户套餐管理折扣列表   企业
//export function getBuinessList(query) {
//return request({
//  url: '/whty/EnterpriseDiscount/getEnterpriseList',
//  method: 'post',
//  data: query
//})
//}

// 导入列表
export function importData(query) {
  return request({
    url: '/system/info/importData',
    method: 'post',
    params: query
  })
}

//卡导入模板接口
//export function importDataTest(query) {
//return request({
//  url: '/system/info/importDataTest',
//  method: 'post',
//  data: query
//})
//}
export function importDataTest1(query) {
return request({
    url: '/system/info/importDataTest1',
    method: 'post',
    data: query
})
}
export function randomValue(query) {   //随机值接口  判断是否收到文件
return request({
    url: '/system/info/randomValue?randomColumn='+query,
    method: 'get',
})
}
//卡导入提交接口
export function importDataTestSubmit(query) {
  return request({
    url: '/system/info/dealCard',
    method: 'post',
    params: query
  })
}

//卡分配提交接口
export function cardFenpeiSubmit(query) {
  return request({
    url: '/system/info/dealCard1',
    method: 'post',
    params: query
  })
}

// 状态更新
export function cardInfoUpdate(query) {
  return request({
    url: '/system/info/cardInfoUpdate?iccids='+query,
    method: 'post',
//  params: query
  })
}

// 单卡进行停机操作
export function cardHalt(query) {
  return request({
    url: '/system/info/cardHalt',
    method: 'post',
    params: query
  })
}
// 单卡进行复机操作
export function cardBegin(query) {
  return request({
    url: '/system/info/cardBegin',
    method: 'post',
    params: query
  })
}

// 单卡进行激活操作
export function cardActive(query) {
  return request({
    url: '/system/info/cardActive',
    method: 'post',
    params: query
  })
}

//卡状态变更
export function cardStatusUpdate(query) {
  return request({
    url: '/system/info/cardStatusUpdate',
    method: 'post',
    params: query
  })
}


//卡导入状态变更
export function cardImportUpdate(query) {
  return request({
    url: '/system/info/cardImportUpdate?key='+query,
    method: 'post',
  }) 
}

//卡信息删除
export function deleteCard(query) {
  return request({
    url: '/system/info/'+query,
    method: 'delete',
  })
}

//查看二维码
export function getCodeImage(query){
  return request({
    url: '/system/info/getCodeImage?iccid='+query,
    method: 'get'
  })
}

//卡详情接口
export function getCardInfo(query){
  return request({
    url: '/system/info/'+query,
    method: 'get'
  })
}


//卡月流量接口
export function getCardFlowUsed(query){
  return request({
    url: '/whty/currentDaytotal/getCardFlowUsed',
    method: 'get',
    params: query
  })
}

//卡月流量日接口   卡列表详情页面
export function getDayCardFlowUsed(query){
  return request({
    url: '/system/info/getDayCardFlowUsed',
    method: 'post',
    params: query
  })
}
//卡月流量月接口   卡列表详情页面
export function getMonthCardFlowUsed(query){
  return request({
    url: '/system/info/getMonthCardFlowUsed',
    method: 'post',
    params: query
  })
}

//充值记录
export function getCardRechargeRecord(query){
  return request({
    url: '/system/info/getCardRechargeRecord',
    method: 'get',
    params: query
  })
}
//是否普通用户
export function normalRole(query){
  return request({
    url: '/system/user/normalRole',
    method: 'get',
    params: query
  })
}


//计费组管理

// 计费组列表
export function accountingGroup(query) {
  return request({
    url: '/whty/countMoneygroup/list',
    method: 'get',
    params: query
  })
}
// 计费组列表  预警 备注
export function accountingGroupUpdata(query) {
  return request({
    url: '/whty/countMoneygroup',
    method: 'put',
    data: query
  })
}
//预警反选
export function accountingGroupSelect(query) {
  return request({
    url: '/whty/countMoneygroup/'+query,
    method: 'get',
  })
}

//webstork
export function webstock(query) {
  return request({
    url: '/system/student/test15?shipId='+query,
    method: 'post',
  })
}



